package com.linkage.jz.bankruptcy.bean;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;

import java.util.ArrayList;
import java.util.List;

/**
 * @author AFAP
 * 讨论
 */
public class ConfigInfo {

    private String id; // 话题id
    private String parentId; // 用户名
    private String path; // 头像

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDisabled() {
        return disabled;
    }

    public void setDisabled(String disabled) {
        this.disabled = disabled;
    }

    private String name; // 话题标题
    private String code; // 话题类型 0-债委会话题; 1-债权人话题
    private String disabled; // 创建时间

    public static List<ConfigInfo> parse(JsonArray arr) {
        List<ConfigInfo> list = new ArrayList<>();
        for (int i = 0; i < arr.size(); i++) {
            list.add(parse(arr.get(i).getAsJsonObject()));
        }
        return list;
    }

    public static ConfigInfo parse(JsonObject obj) {
        ConfigInfo bean = new Gson().fromJson(obj, ConfigInfo.class);

        return bean;
    }

}
